package com.project.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.entity.*;
import com.project.service.IUserOrderRefundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("UserOrderRefund")
public class UserOrderRefundController {

    @Autowired
    private IUserOrderRefundService service;


    //用户退款
    @RequestMapping("UserRefund")
    public String UserRefund(long refundId,int status,String cause) {
        service.UserRefund(refundId,status,cause);
        return "ok";
    }

//    @RequestMapping("SupplyRefund")
//    public String SupplyRefund(SupplyRefundEntity supplyOrderRefundRecordEntity) {
//        service.SupplyRefund(supplyOrderRefundRecordEntity);
//        return "ok";
//    }


//    @RequestMapping("refundMoney")
//    public String refundMoney(SupplyRefundEntity supplyOrderRefundRecordEntity) {
//       service.refundMoney(supplyOrderRefundRecordEntity);
//       return "ok";
//    }

    @RequestMapping("findByItemUser")
    public IPage<UserOrderRefundEntity> findByItemUser(int pageNO, int pageSize,int status) {
        return service.findByItemUser(pageNO,pageSize, status);
    }

    @RequestMapping("findByIdUser")
    public UserOrderRefundEntity findByIdUser(String orderRef) {
        return service.findByIdUser(orderRef);
    }

    @RequestMapping("findByItemSupply")
    public IPage<SupplyRefundEntity> findByItemSupply(int pageNO, int pageSize) {
        return service.findByItemSupply(pageNO,pageSize);
    }

    @RequestMapping("findByIdSupply")
    public SupplyRefundEntity findByIdSupply(Integer id) {
        return service.findByIdSupply(id);
    }
}
